<?php

namespace app\index\validate;

use think\Validate;

class Vali extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
	    'userName'                  =>                      'require|max:8',
        'password'                   =>                      'require|length:6,10|alphaNum',
        'rePassword'               =>                       'require|confirm:password',
        'role'                            =>                       'require|max:1|number',
        'ProName'                   =>                       'require|max:50',
        'ProContent'                =>                       'require|max:100',
        'ProStart'                     =>                       'require',
        'ProEndTime'              =>                       'require|gt:ProStart',
        'ProNum'                     =>                       'require|max:2',
        'ProOpt'                      =>                       'require',
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [];

    /**
     * 定义场景验证
     * @var \string[][]
     */
    protected $scene = [
        'register'                  =>                  ['userName','password','rePassword','role'],
        'addProject'             =>                  ['ProName','ProContent','ProStart','ProEndTime','ProNum','ProOpt']
    ];
}
